home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / newrouts / newrouts.bas < prev    next >
BASIC Source File  |  1997-06-13  |  1KB  |  39 lines

  1. Attribute VB_Name = "modRoutines"
  2. 'In general declarations of a .BAS Module
  3. Declare Function OSWritePrivateProfileString% Lib "Kernel32" Alias "WritePrivateProfileStringA" (ByVal AppName$, ByVal KeyName$, ByVal keydefault$, ByVal FileName$)
  4. Declare Function OSGetPrivateProfileString% Lib "Kernel32" Alias "GetPrivateProfileStringA" (ByVal AppName$, ByVal KeyName$, ByVal keydefault$, ByVal ReturnString$, ByVal NumBytes As Integer, ByVal FileName$)
  5.  
  6. Public gobjVBInst As Object
  7. Public gIsFunction As Boolean
  8. Public gMaxLen%, gAuthorName$
  9. Public gParms(), EasterEgg As Boolean
  10.  
  11. Sub Main()
  12.     '**************************************
  13.     '* Author : Michael J. Cox
  14.     '* Date : 6/13/97
  15.     '* Email : mikec247@ix.netcom.com
  16.     '*
  17.     '* Desc:
  18.     '*   This is the entrance point of
  19.     '*   Addin. When the EXE is executed
  20.     '*   The Addin will register itself
  21.     '***********************************
  22.     Dim ReturnString As String
  23.     Dim Section As String
  24.     Dim ErrCode
  25.     
  26.     '--- Check to see if we are in the VB.INI File.
  27.     '  If not, Add ourselves to the INI file
  28.     Section = "Add-Ins32"
  29.     
  30.     ReturnString = String$(12, Chr$(0))
  31.     ErrCode = OSGetPrivateProfileString(Section$, "NewRouts.NewRout", "NotFound", ReturnString, Len(ReturnString) + 1, "VB.INI")
  32.     If Left(ReturnString, ErrCode) = "NotFound" Then
  33.       ErrCode = OSWritePrivateProfileString%(Section$, "NewRouts.NewRout", "0", "VB.INI")
  34.     End If
  35. End Sub
  36.  
  37.  
  38.  
  39.